Method of automatically testing audio-video synchronization

ABSTRACT

A method of testing audio/video synchronization comprising calculating a frequency of a device used to encode a digital stream based on program clock references calculating first time differences between audio decoding time stamps and actual audio decoding times; calculating second time differences between audio presentation time stamps and actual audio presentation times; calculating third time differences between video decoding time stamps and 4 actual video decoding times; and calculating fourth time differences between video presentation time stamps and actual video presentation times.

CROSS REFERENCE TO RELATED CASES

Applicants claim the benefit of Provisional Application Ser. No.60/430,917, filed Dec. 4, 2002.

The present invention relates to the field of digital signal processing,more specifically, it relates to a method for testing audio/videosynchronization (AVsync) in receiver hardware, software,hardware/software combinations and is readily extendable to testing thedigital signals themselves.

The Moving Pictures Expert Group (MPEG) standard is a digitalaudio/video (A/V) compression standard employed in a variety of A/Vdistribution systems including, for example, Digital Satellite System(DSS) broadcasting, Digital Cable broadcasting and Digital terrestrialbroadcasting. At the receiving end, the compressed A/V digital streamshave to be uncompressed and decoded. The MPEG standard provides fieldssuch as program clock reference (PCR), presentation time stamp (PTS),decode time stamp (DTS) and system time clock (STC) (of the MPEGencoder). The PCR bears a strict relationship to the STC within the MPEGencoder that generates the broadcast stream, and therefore may beemployed to replicate the encoder's time clock at the decoder's end. TheDTS's are used by the decoders to determine when an audio unit or videoframe is to be decoded and the PTS's are used to determine when thedecoded audio unit or video frame is to be presented. It is criticalthat the audio and video data be both decoded and presented in properAVsync.

When a receiver system (hardware, software or both) is designed, it mustbe tested to ensure that AVsync performance of the system complies withthe MPEG standard. Currently, testing requires a human being to observea video clip and, listen to the accompanying audio and make a subjectivedetermination of acceptable AVsync. This is very labor intensive, notvery accurate and not very precise.

A more precise testing adds a flash to the video and a beep to the audioand an oscilloscope is used to measure the AVsync. This still requires ahuman observer as well as a special test signal, and the accuracy andprecision is dependent upon the skill of the oscilloscope operator andthe calibration of the oscilloscope. Further, long term testing requiresperiodic human intervention for adjustment of the oscilloscope.

These two test methods are labor intensive and thus expensive, and donot provide the required accuracy or repeatability needed for quickdebug of AVsync problems, so repeated testing is often necessary.

Therefore, there is a need for a non-subjective, highly precise andhighly repeatable method of AVsync testing that is inexpensive andstable over prolonged test times.

A first aspect of the present invention is a method of testingaudio/video synchronization of a decoder device for receiving a digitalstream, the digital stream containing system time clock fields, programclock reference fields, audio decoding time stamp fields, audiopresentation time stamp fields, video decoding time stamp fields andvideo presentation time stamp fields, comprising: recovering at leasttwo sequential program clock references from the program clock referencefields; calculating a frequency of a device used to encode the digitalstream based on the sequential program clock references and decoder timestamps of when the sequential program clock references were recovered;generating an audio elementary stream and a video elementary stream fromthe digital stream; recovering from the audio elementary stream at leastone audio decoding time stamp from the audio decoding time stamp fieldsand calculating a first time difference between the audio decoding timestamp and a first decoder time stamp of when an audio unit correspondingto the audio decoding time stamp was decoded; recovering from the audioelementary stream at least one audio presentation time stamp from theaudio presentation time stamp fields and calculating a second timedifference between the audio presentation time stamp and a seconddecoder time stamp of when an audio unit corresponding to the audiopresentation time stamp was presented; recovering from the videoelementary stream at least one video decoding time stamp from the videodecoding time stamp fields and calculating a third time differencebetween the video decoding time stamp and a third decoder time stamp ofwhen a video frame corresponding to the video decoding time stamp wasdecoded; and recovering from the video elementary stream at least onevideo presentation time stamp from the video presentation time stampfields and calculating a fourth time difference between the videopresentation time stamp and a fourth decoder time stamp of when the avideo frame corresponding to the video presentation time stamp waspresented.

A second aspect of the present invention is a method of testingaudio/video synchronization of a decoder device under test, the decoderdevice receiving a digital stream, the digital stream containing systemtime clock fields, program clock reference fields, audio decoding timestamp fields, audio presentation time stamp fields, video decoding timestamp fields and video presentation time stamp fields, comprising:providing a frequency extractor module in a de-multiplexer of thedecoder device, the frequency extractor module adapted to recover atleast two sequential program clock references from the program clockreference fields; calculating a frequency of a device used to encode thedigital stream based on the sequential program clock references anddecoder time stamps of when the sequential program clock references wererecovered; generating an audio elementary stream and a video elementarystream from the digital stream; providing an audio delta calculatormodule in an audio decoder, the audio delta calculator module adapted torecover from the audio elementary stream at least one audio decodingtime stamp from the audio decoding time stamp fields and adapted tocalculate a first time difference between the audio decoding time stampand a first decoder time stamp of when an audio unit corresponding tothe audio decoding time stamp was decoded and adapted to recover fromthe audio elementary stream at least one audio presentation time stampfrom the audio presentation time stamp fields and adapted to calculate asecond time difference between the audio presentation time stamp and asecond decoder time stamp of when the audio unit corresponding to theaudio presentation time stamp was presented; and providing a video deltacalculator module, the video delta calculator adapted to recover fromthe video elementary stream at least one video decoding time stamp fromthe video decoding time stamp fields and adapted to calculate a thirdtime difference between the video decoding time stamp and a thirddecoder time stamp of when a video frame corresponding to the videodecoding time stamp was decoded and adapted to recover from the videoelementary stream at least one video presentation time stamp from thevideo presentation time stamp fields and adapted to calculate a fourthtime difference between the video presentation time stamp and a fourthdecoder time stamp of when the video frame corresponding to the audiopresentation time stamp was presented

A third aspect of the present invention is a method of testingaudio/video synchronization in a digital stream, the digital streamcontaining system time clock fields, program clock reference fields,audio decoding time stamp fields, audio presentation time stamp fields,video decoding time stamp fields and video presentation time stampfields, comprising: receiving the digital stream in a decoder devicehaving a known degree of audio/video synchronization; recovering atleast two sequential program clock references from the program clockreference fields; calculating a frequency of a device used to encode thedigital stream based on the sequential program clock references anddecoder time stamps of when the sequential program clock references wererecovered; generating an audio elementary stream and a video elementarystream from the digital stream; recovering from the audio elementarystream at least one audio decoding time stamp from the audio decodingtime stamp fields and calculating a first time difference between theaudio decoding time stamp and a first decoder time stamp of when anaudio unit corresponding to the audio decoding time stamp was decoded;recovering from the audio elementary stream at least one audiopresentation time stamp from the audio presentation time stamp fieldsand calculating a second time difference between the audio presentationtime stamp and a second decoder time stamp of when the audio unitcorresponding to the audio presentation time stamp was presented;recovering from the video elementary stream at least one video decodingtime stamp from the video decoding time stamp fields and calculating athird time difference between the video decoding time stamp and a thirddecoder time stamp of when a video frame corresponding to the videodecoding time stamp was decoded; and recovering from the videoelementary stream at least one video presentation time stamp from thevideo presentation time stamp fields and calculating a fourth timedifference between the video presentation time stamp and a fourthdecoder time stamp of when the video frame corresponding to the audiopresentation time stamp was presented.

The features of the invention are set forth in the appended claims. Theinvention itself, however, will be best understood by reference to thefollowing detailed description of an illustrative embodiment when readin conjunction with the accompanying drawings, wherein:

FIG. 1 is a schematic diagram of the data structure of an MPEG transportstream;

FIG. 2 is a schematic diagram of the data structure of an MPEG programstream;

FIG. 3 is a schematic diagram of the data structure of an MPEGpacketized elementary stream;

FIG. 4 is a schematic block diagram of an exemplary system according tothe present invention;

FIG. 5 is a flowchart of a first embodiment of the present invention;and

FIG. 6 is a flowchart of a second embodiment of the present invention.

The term and data structures of MPEG are used in describing the presentinvention. It should be understood that the term MPEG may be replaced byMPEG-1, MPEG-2, MPEG-4, MPEG-7, digital satellite system (DSS) datastructures or other standards that share common digital streamstructures with or are built upon the MPEG standard. Further, the termMPEG is intended to cover all these aforementioned standards.

The invention is applicable to any product utilizing any of the abovedata structures or standards including, but not limited to, digital andhybrid television, digital video disk players, MPEG players and set topboxes.

However, the invention will be described for a MPEG receiver, receivingan MPEG encoded signal.

FIGS. 1 through 3 are provided as an aid to understanding the presentinvention and merely illustrate the MPEG standard digital streamstructure.

FIG. 1 is a schematic diagram of the data structure of an MPEG transportstream. A transport stream carries multiple programs. A transport streamis comprised of multiple 188 byte units, each which includes a headerand a payload. Headers are divided into the following fields: a syncbyte field, a transport error indicator field, a payload unit startindicator field, a transport priority field, a packet ID (PID) field, atransport scrambling control field, an adaptation field control field, acontinuity counter field and adaptation field. The PID field are ofespecial interest for the present invention.

The adaptation field is further divided into the following fields: anadaptation field length field, a discontinuity counter field, a randomaccess indicator field, an elementary stream priority indicator field, afield of 5 flags pointing to an optional fields field and a stuffingbytes field.

The optional fields field is further divided into a program clockreference (PCR) field, a old program clock reference field (OPCR) asplice counter field, a transport private data length field, a transportprivate data field, an adaptation field extension length field and afield of three flags pointing to an optional fields field. The PCR fieldis of especial interest for the present invention.

The optional fields field is further divided into fields as illustratedin FIG. 1.

Each payload generally contains data in the form of pieces of packetizedelementary streams (PES). However, data in other data formats may bepacked into a payload. Video, audio, entitlement management message andentitlement control message data is always packed in PES format. Thedata structure of an MPEG PES stream is illustrated in FIG. 3 anddescribed infra.

FIG. 2 is a schematic diagram of the data structure of an MPEG programstream. A program stream is a variable length structure composed ofmultiple packs, each pack is divided into a pack header and one or morePES packets. A program stream carries only one program. The datastructure of an MPEG PES stream is illustrated in FIG. 3 and describedinfra. Pack headers are divided in the following fields: a pack startcode field, a “01” field, an system clock reference (SCR) field, aprogram MUX rate field, a pack stuffing length field, a pack stuffingbyte field and a system header field.

The system header field is further divided into a system header startcode field, a header length field, a rate bound field, an audio boundfield, a fixed flag field, a CSPS fag, a video bound field and an N loopfield.

The N loop field is further divided into a stream ID field, a “11”field, a P-std buffer bound scale field, a P-std buffer size boundfield, and other fields.

FIG. 3 is a schematic diagram of the data structure of an MPEGpacketized elementary stream (PES). A PES stream is a variable lengthstructure composed of a packet start code prefix field, a stream IDfield, a PES packet length field, an optional PES header field and afield for the actual PES packet data. The optional PES header field isdivided and sub-divided as illustrated in FIG. 3. The PTS/DTS filed ofthe optional field of the optional PES header filed is of especialinterest to the present invention.

FIG. 4 is a schematic block diagram of an exemplary system according tothe present invention. In FIG. 4, receiver 100 includes a receivercontroller 105 containing a conditional access subsystem 110 and a tunerand demodulator 115 for receiving a modulated MPEG stream 120 (a digitalstream) and passing an encrypted MPEG stream 125 to a MPEG streamde-multiplexer and decryptor 130. Conditional access subsystem 110includes the functions for providing decryption support to MPEG streamde-multiplexer and decryptor 130. Conditional access subsystem 110 isoptional and is only required when modulated MPEG stream 120 isencrypted. Similarly, MPEG stream de-multiplexer and decryptor 130 needhave decrypting capability only if modulated MPEG stream 120 isencrypted. MPEG de-multiplexer and decryptor 130 converts transportstream 125 into an audio elementary stream (ES) 140 and a video ESstream 145.

An audio decoder 150 receives audio elementary stream 140 and convertsthe audio ES into playable audio output 155. A video decoder 160receives video ES streams 145 converts the video ES to playable videooutput 165. Both audio output 155 and video output 165 are suitable foruse by normal television, audio and/or computer equipment A variety ofcontrol signals 170 are sent by receiver controller 105 (or conditionalaccess subsystem 110) to MPEG de-multiplexer and decryptor 130, audiodecoder 155 and video decoder 160 to control and coordinate theoperations of the MPEG de-multiplexer and decryptor and the audio andvideo decoders.

Receiver 100 further includes a local system time clock (STC) 175 and astorage subsystem 180. Storage subsystem 180 may comprise storage mediasuch as hard disks, re-writable CD drives, re-writable DVD drives,semiconductor storage or even tape.

Local STC 175 receives a recovered PCR signal 185 from MPEG streamde-multiplexer and decryptor 130 and generates a local time signal (LTS)190. LTS 190 is provided to audio decoder 155 and video decoder 160. PCRsignal 185 is a stream of PCR's recovered from the PCR field in the MPEGtransport stream as illustrated in FIG. 1.

There are five measures of AVsync. The first measure is the frequency ofdecoder STC 175. The frequency of the encoder STC (the STC in the unitthat created modulated MPEG stream 120) generally runs, in one example,at a standard FREQENCODER=27 MHz+/−810 cycles. The frequency of decoderSTC 175 is calculated by the formula:FREQDECODER=((PCRT−1)−(PCRT))/(TT−1−TT), where PCRT is the PCR recoveredat local time TT, PCRT−1 is the PCR recovered at local time TT−1. IfFREQDECODER differs from the prescribed 27 MHz+/−810 cycles thenreceiver 100 is inherently in an out of AVsync condition because clockall operations of decoding and presentation of audio units and videoframes will be performed in a different time relationship than that usedwhen the audio and video were encoded. To this end, MPEG streamde-multiplexer and decryptor 130 is provided with a frequency extractormodule 195, which sends time stamped frequency data 200 to storagesubsystem 180.

The second measure of AVsync is the difference (_dta) between arecovered audio DTS and an actual audio decoding time (LTSAD), which maybe expressed as _dta=DTS−LTSAD. The third measure of AVsync is thedifference (_pta) between a recovered audio PTS and an actual audiopresentation time (LTSAP), which may be expressed as _dpa=PTS−LTSAP.DTS's and PTS's are recovered from the PTS/DTS field of the MPEG PESillustrated in FIG. 3. For perfect AVsync _dta and _pta are equal tozero. If _dta is not equal to zero then decode of audio units is notbeing performed to the same timing relationship as encode of those audiounits was performed in the encoder. If _pta is not equal to zero thenpresentation of audio units in receiver 100 is not being performed inthe same timing relationship as when the audio units were presented forencode in the encoder. To this end, audio decoder 150 is provided withan audio delta calculator module 205, which sends time stamped _dta'sand _pta's (signal 210) to storage subsystem 180.

The fourth measure of AVsync is the difference (_dtv) between arecovered video DTS and an actual video decoding time (LTSVD), which maybe expressed as _dtv=DTS−LTSvD. The fifth measure of AVsync is thedifference (_ptv) between a recovered video PTS and an actual videopresentation time (LTSVP), which may be expressed as _dpva=PTS−LTSVP.DTS's and PTS's are recovered from the PTS/DTS field of the MPEG PESillustrated in FIG. 3. For perfect AVsync, _dtv and _ptv are equal tozero. If _dtv is not equal to zero then decode of video units (generallyframes) is not being performed to the same timing relationship as encodeof those video units was performed in the encoder. If _ptv is not equalto zero then presentation of video units in receiver 100 is not beingperformed in the same timing relationship as when the video units werepresented for encode in the encoder. To this end, video decoder 160 isprovided with a video delta calculator module 215, which sends timestamped _dtv's and _ptv's (signal 220) to storage subsystem 180.

FREQDECODER's, _dta's, _pta's, _dtv's and _ptv's along with the LTS timestamp are collected in a table 225 within storage subsystem 180. Inoperation, during the testing of receiver 100, known good MPEG stream ispresented to the receiver and FREQDECODER's, _dta's, _pta's, _dtv's and_ptv's are sampled periodically and added to table 225. This isperformed without any operator intervention and may be performed over asshort a period of time or over as long a period of time as desired andperformed using as many different MPEG streams are desired. At the endof testing, table 225 is downloaded to computer 230 and analysis of theLTS,s, FREQDECODER's, _dta's, _pta's, _dtv's and _ptv's performed.

In an alternative embodiment, storage subsystem 180 resides withincomputer 230 instead of within receiver system 100.

Testing, tests both the hardware and software of receiver 100. Anyerrors detected in hardware or software can then be fixed and additionaltesting performed until desired test results are obtained. Frequencyextractor 195, audio delta calculator module 205 and video deltacalculator module 215 are generally implemented in software and thenonly in the test version of the software loaded onto receiver 100.Frequency extractor 195, audio delta calculator module 205 and videodelta calculator module 215 are generally not present within thesoftware shipped with production hardware. Because there is no humanintervention, testing is more though, more accurate and more precisethan hereto has been obtained by conventional testing means.

FIG. 5 is a flowchart of a first embodiment of the present invention. Instep 250, a known good MPEG stream is received. A known good MPEG streamis at one level, a stream that is MPEG compliant, and on another levelis a stream known to produce FREQDECODER's=27 KHz+/−810 cycle, _dta's=0,_pta's=0, _dtv's=0 and _ptv's=0 on a test system as illustrated in FIG.4 and described supra. FREQDECODER need not be exactly equal to 27MHz+/−810 cycles, but sufficiently close so the presented audio andvideo signals are perceived by a viewer not to be out ofsynchronization. Likewise the _dta's, _pta's, _dtv's and _ptv's need notbe exactly zero, but sufficiently close enough to zero so the presentedaudio and video signals are perceived by a viewer not to be out ofsynchronization.

In step 255 the MPEG stream is de-multiplexed and optionally decrypted.In step 260, the PCRs from the MPEG transport stream are recovered andthe encoder frequency FREQDECODER calculated as described supra. Thecalculated frequency, along with the local time (receiver time) isstored in step 265. Steps 255, 260 and 265 continuously repeat everytime a new PCR is detected.

In step 270, in the case of an audio unit, values for _dta and _pta arecalculated as described supra in reference to FIG. 4, and the _dta and_pta values, along with the local time (receiver time) are stored instep 265. In the case of a video unit, values for _dtva and _ptv arecalculated as described supra in reference to FIG. 4, and the _dtv and_ptv values, along with the local time (receiver time) are stored instep 265. Step 275 creates a delay until the next audio or video unit isdetected and then the method loops back to step 270. Audio/video unitdetection is accomplished by detection of a PTS/DTS field in the MPEGPES illustrated in FIG. 3. Determination of audio unit or video unit isbased upon the PID field of the transport stream illustrated in FIG. 1.

In step 280, the stored and time stamped FREQDECODER, _dta, _pta, _dtvand _ptv values may be reviewed real time, any time during test, orafter test is complete. The time stamp allows specific values or timeranges of FREQDECODER, _dta, _pta, _dtv to be related to specifictemporal audio and video units, greatly aiding in hardware and softwaredebug for problems, among others, that may be content related.

FIG. 6 is a flowchart of a second embodiment of the present invention.The receiver illustrated in FIG. 4 and described supra, may be used totest MPEG streams for compliance to MPEG standards in terms of AVsync.All that is required is a hardware/software combination that is known tobe capable of a high degree of AVsync. Therefore, steps 305, 310, 315,320, 325 and 330 of FIG. 6 are identical to respective steps 250, 255,260, 265, 270, 275 and 280 of FIG. 5 as described supra. The significantdifference is that in step 300 a MPEG stream of unknown AVsync qualityis received. In step 330, the stored and time stamped FREQDECODER, _dta,_pta, _dtv and _ptv values may be reviewed real time, any time duringtest, or after test is complete. The time stamp allows specific valuesor time ranges of FREQDECODER, _dta, _pta, _dtv to be related tospecific temporal audio and video units, greatly aiding determiningspecific portions of the MPEG stream or audio or video units that areresponsible for AVsync problems.

The description of the embodiments of the present invention is givenabove for the understanding of the present invention. It will beunderstood that the invention is not limited to the particularembodiments described herein, but is capable of various modifications,rearrangements and substitutions as will now become apparent to thoseskilled in the art without departing from the scope of the invention.Therefore, it is intended that the following claims cover all suchmodifications and changes as fall within the true spirit and scope ofthe invention.

1. A method of testing audio/video synchronization of a decoder devicefor receiving a digital stream, said digital stream containing systemtime clock fields, program clock reference fields, audio decoding timestamp fields, audio presentation time stamp fields, video decoding timestamp fields and video presentation time stamp fields, comprising:recovering at least two sequential program clock references from saidprogram clock reference fields; calculating a frequency of a device usedto encode said digital stream based on said sequential program clockreferences and decoder time stamps of when said sequential program clockreferences were recovered; generating an audio elementary stream and avideo elementary stream from said digital stream; recovering from saidaudio elementary stream at least one audio decoding time stamp from saidaudio decoding time stamp fields and calculating a first time differencebetween said audio decoding time stamp and a first decoder time stamp ofwhen an audio unit corresponding to said audio decoding time stamp wasdecoded; recovering from said audio elementary stream at least one audiopresentation time stamp from said audio presentation time stamp fieldsand calculating a second time difference between said audio presentationtime stamp and a second decoder time stamp of when an audio unitcorresponding to said audio presentation time stamp was presented;recovering from said video elementary stream at least one video decodingtime stamp from said video decoding time stamp fields and calculating athird time difference between said video decoding time stamp and a thirddecoder time stamp of when a video frame corresponding to said videodecoding time stamp was decoded; and recovering from said videoelementary stream at least one video presentation time stamp from saidvideo presentation time stamp fields and calculating a fourth timedifference between said video presentation time stamp and a fourthdecoder time stamp of when said a video frame corresponding to saidvideo presentation time stamp was presented.
 2. The method of claim 1,further including: storing said calculated frequency, said first timedifference, said second time difference, said third time difference andsaid fourth time difference.
 3. The method of claim 2, furtherincluding: storing a decoder time stamp of when said calculatedfrequency was calculated, said first decoder time stamp, said seconddecoder time stamp, said third decoder time stamp and said fourthdecoder time stamp.
 4. The method of claim 3, wherein said storing saidcalculated frequency, said first time difference, said second timedifference, said third time difference and said fourth time difference;and said storing a decoder time stamp of when said calculated frequencywas calculated, said first decoder time stamp, said second decoder timestamp, said third decoder time stamp and said fourth decoder time stampare stored on storage media internal to said decoder device.
 5. Themethod of claim 3, wherein said storing said calculated frequency, saidfirst time difference, said second time difference, said third timedifference and said fourth time difference and said storing a decodertime stamp of when said calculated frequency was calculated, said firstdecoder time stamp, said second decoder time stamp, said third decodertime stamp and said fourth decoder time stamp are stored on storagemedia external to said decoder device.
 6. The method of claim 1, furtherincluding: generating said first, second, third and fourth decoder timestamps based on program clock references recovered from said programclock reference fields of said digital stream.
 7. The method of claim 1,further including: generating said first, second, third and fourthdecoder time stamps based on said frequency of said device used toencode said digital stream.
 8. The method of claim 1 further including:comparing said calculated frequency to a known value of said encoderfrequency; and comparing said first time difference to zero, said secondtime difference to zero, said third time difference to zero and saidfourth time difference to zero.
 9. A method of testing audio/videosynchronization of a decoder device under test, said decoder devicereceiving a digital stream, said digital stream containing system timeclock fields, program clock reference fields, audio decoding time stampfields, audio presentation time stamp fields, video decoding time stampfields and video presentation time stamp fields, comprising: providing afrequency extractor module in a de-multiplexer of said decoder device,said frequency extractor module adapted to recover at least twosequential program clock references from said program clock referencefields; calculating a frequency of a device used to encode said digitalstream based on said sequential program clock references and decodertime stamps of when said sequential program clock references wererecovered; generating an audio elementary stream and a video elementarystream from said digital stream; providing an audio delta calculatormodule in an audio decoder, said audio delta calculator adapted moduleto recover from said audio elementary stream at least one audio decodingtime stamp from said audio decoding time stamp fields and adapted tocalculate a first time difference between said audio decoding time stampand a first decoder time stamp of when an audio unit corresponding tosaid audio decoding time stamp was decoded and adapted to recover fromsaid audio elementary stream at least one audio presentation time stampfrom said audio presentation time stamp fields and adapted to calculatea second time difference between said audio presentation time stamp anda second decoder time stamp of when said audio unit corresponding tosaid audio presentation time stamp was presented; and providing a videodelta calculator module, said video delta calculator module adapted torecover from said video elementary stream at least one video decodingtime stamp from said video decoding time stamp fields and adapted tocalculate a third time difference between said video decoding time stampand a third decoder time stamp of when a video frame corresponding tosaid video decoding time stamp was decoded and adapted to recover fromsaid video elementary stream at least one video presentation time stampfrom said video presentation time stamp fields and adapted to calculatea fourth time difference between said video presentation time stamp anda fourth decoder time stamp of when said video frame corresponding tosaid audio presentation time stamp was presented.
 10. The method ofclaim 9, further including: storing said calculated frequency, saidfirst time difference, said second time difference, said third timedifference and said fourth time difference; and storing a decoder timestamp of when said calculated frequency was calculated, said firstdecoder time stamp, said second decoder time stamp, said third decodertime stamp and said fourth decoder time stamp.
 11. The method of claim 9further including: comparing said calculated frequency to a known valueof said encoder frequency; and comparing said first time difference to afirst predetermined value, said second time difference to a secondpredetermined value, said third time difference to a third predeterminedvalue and said fourth time difference to a fourth predetermined value.12. The method of claim 11, further including: modifying said decoderdevice in response to said calculated frequency differing from a knownvalue of said encoder frequency by a pre-determined amount; andmodifying said decoder in response to said first time difference, saidsecond time difference, said third time difference or said fourth timedifference differing from respective said first, second, third andfourth predetermined values by respective predetermined first, second,third and fourth amounts.
 13. The method of claim 9, further includingremoving said frequency extractor module, said audio delta calculatormodule and said video delta calculator module from said decoder deviceafter testing is complete.
 14. The method of claim 9, further including:generating said first, second, third and fourth decoder time stampsbased on program clock references recovered from said program clockreference fields of said digital stream.
 15. The method of claim 9,further including: generating said first, second, third and fourthdecoder time stamps based on said frequency of said device used toencode said digital stream.